# -*- coding: utf-8 -*-
"""
# @Time    : 2021/1/7 下午4:16
# @Author  : tgy
"""
from functools import wraps


def outer01(func):
    print('outer01')

    def inner01(*args, **kwargs):
        print("before inner01")
        result = func(*args, **kwargs)
        print("after inner01")
        return result

    return inner01


def outer02(func):
    print("outer02")

    def inner02(*args, **kwargs):
        print("before inner02")
        result = func(*args, **kwargs)
        print("after inner02")
        return result

    return inner02


def outer03(path, method="get"):
    def method03(func):
        print("method03")

        def inner03(*args, **kwargs):
            print("before inner03")
            result = func(*args, **kwargs)
            print("after inner03")
            return result

        return inner03

    return method03


@outer01  # search = outer01(search) => search = inner01
@outer03(path="/login")  # outer03(path="/login") => @method03 => search = method03(search) => search = inner03
@outer02  # search = outer02(search) => searc == inner02
def search(name):
    print(name.upper())


if __name__ == '__main__':
    ...
    print(search)
    search('zhansan')
    names = ['zhangsan', 'lisi', 'wangwu']
    person = {i: name for i, name in enumerate(names) if name.endswith('wu')}
    print(person)
